import 'package:flutter/material.dart';

class Allusions extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    const String content =
        '''  《闻官军收河南河北》作于公元763年（广德元年）春天，那时杜甫52岁。宝应元年（公元762年）冬季，唐军在洛阳附近的衡水打了一个大胜仗，叛军头领薛嵩、张忠志等纷纷投降。作者听到这个消息后欣喜若狂，写下此诗。
''';

    Widget contentWidget = Padding(
      padding: EdgeInsets.all(20),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          Text(
            "创作背景",
          ),
          Text(
            "$content",
            textScaleFactor: 0.8,
            style: TextStyle(
              height: 1.4,
            ),
          ),
        ],
      ),
    );

    return Padding(
      padding: EdgeInsets.all(16.0),
      child: Card(
        child: LayoutBuilder(builder:
            (BuildContext context, BoxConstraints viewportConstraints) {
          return SingleChildScrollView(
            child: ConstrainedBox(
              constraints: BoxConstraints(
                minHeight: viewportConstraints.maxHeight,
              ),
              child: contentWidget,
            ),
          );
        }),
      ),
    );
  }
}
